package com.canomo.modules.inventory.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.io.Serializable;

/**
 * <p>
 * 产品和供应商关系表
 * </p>
 *
 * @author xiaoj
 * @since 2018-07-23
 */
@TableName("inv_product_supplier")
public class ProductSupplier extends Model<ProductSupplier> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ID_WORKER)
    @JsonSerialize(using=ToStringSerializer.class)
    private Long id;

    /**
     * 产品ID
     */
    @TableField("product_id")
    @JsonSerialize(using=ToStringSerializer.class)
    private Long productId;

    /**
     * 供应商ID
     */
    @TableField("supplier_id")
    @JsonSerialize(using=ToStringSerializer.class)
    private Long supplierId;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }
    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "ProductSupplier{" +
        "id=" + id +
        ", productId=" + productId +
        ", supplierId=" + supplierId +
        "}";
    }
}
